import _ from "lodash/array";

const state = {
    panes: [],
    JumpAddress: ""
};
const mutations = {
    SET_PANES(state, val) {
        const item = state.panes;
        const newArray = item.concat(val);
        const result = _.uniqBy(newArray, "name");
        state.panes = result;
    },
    RESET_PANES(state: any, val: object) {
        state.panes = val;
    },
    SET_JUMPADDRESS(state: any, val: string) {
        state.JumpAddress = val;
    }
};
const getters = {
    getPanes(state: any) {
        return state.panes;
    },
    getjumpAddress(state) {
        return state.JumpAddress;
    }
};
const actions = {};
export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters
};
